refactor(gfql): fuse polars seeded RETURN-dst helper into one collect_all (#1755)#1765
Closed
lmeyerov wants to merge 1 commit into
Closed
refactor(gfql): fuse polars seeded RETURN-dst helper into one collect_all (#1755)#1765lmeyerov wants to merge 1 commit into
lmeyerov wants to merge 1 commit into
Conversation
…#1755) The eager form paid ~19 fixed-cost collects per execution (~70% of the fast path's time, same profile signature as the two-star OLAP lane). The same seed-first reduction now composes as one lazy plan over semi-joins on drop_nulls()'d id sets and collects once via pl.collect_all([dstn, edges]). Value-identical rows (row order may differ — documented contract); the empty-seed early return is subsumed (empty seed flows through to empty, schema-identical frames). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL
lmeyerov
force-pushed
the
perf/gfql-seeded-polars-fused-collect
branch
from
July 21, 2026 22:34
607f42c to
052a6f7
Compare
Contributor
Author
|
Closing as obsolete rather than rebasing — three reasons, two from this PR's own body:
If a semi-join/lazy form is wanted later, it should be designed against the post-index helper shape (and only with a measured win). Reopen if that reading is wrong. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
_seeded_typed_return_dst_polarsnow composes its seed-first reduction as one lazy plan (semi-joins overdrop_nulls()'d id sets) and collects once viapl.collect_all([dstn, edges]), replacing ~8 eager ops (19 internal collects/exec). The empty-seed early return is subsumed (empty flows through to schema-identical empty frames). Value-identical rows; row order may differ (documented contract). Also removes the wholeis_in(...implode())deprecation surface.Honest perf note
Hypothesis was collect-overhead dominance (as in the two-star OLAP lane, where fusion won 30-40%). Refuted here: profiling shows the single fused collect takes ~3.0ms itself — this path is compute-dominated (columnar scans over the edge frame), so fusion is perf-neutral (dgx same-session: median 3.38→3.23ms, min ~2.2; within noise). Shipping as a simplification, not a speedup. The real ≤2ms lever for seeded polars is engaging the resident #1658 adjacency index from the cypher fast path — follow-up, tracked in plans/gfql-benchmark-numbers.
Testing
Full seeded suite (51) green, incl. the polars gate tests (LazyFrame/mixed-engine decline, null-id parity, labels precedence) and the per-engine differential sweep; dgx 4-engine probe: engaged + parity on all engines.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL